package com.example.myapplication_2.service.serviceImpl;

import com.example.myapplication_2.mapper.SymptomMapper;
import com.example.myapplication_2.service.SymptomService;

import java.util.List;

public class SymptomServiceImpl implements SymptomService {

    private SymptomMapper  symptomMapper = new SymptomMapper();

    /**
     * 查找除usedSymptom以外的任意八个症状字符串
     * @param usedSymptom 标签内已有的症状信息集合
     */
    @Override
    public List<String> findSymptom(List<String> usedSymptom) {

        return symptomMapper.selectSymptom(usedSymptom);
    }

    /**
     * 获取所有症状
     * @return 所有症状集合
     */
    @Override
    public List<String> findAllSymptom() {
        return symptomMapper.selectAllSymptom();
    }

    /**
     * 按关键字搜索症状
     * @param word 关键字
     * @return 包含关键字的症状集合
     */
    @Override
    public List<String> findSymptomByWord(String word) {
        return symptomMapper.selectSymptomByWord(word);
    }

    /**
     * 获得用户选中的症状信息
     * @param confirmSymptom 点击确认按钮后获得的症状信息
     */
    @Override
    public void confirmSymptom(List<String> confirmSymptom) {
        symptomMapper.confirmSymptom(confirmSymptom);
    }


}
